package com.castle.fortress.admin.oa.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.util.Date;
import java.util.List;

import lombok.Data;
import com.baomidou.mybatisplus.annotation.*;
import lombok.EqualsAndHashCode;
import com.castle.fortress.admin.core.entity.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 上下班考勤记录 实体类
 *
 * @author whc
 * @since 2022-11-04
 */
@Data
@TableName("oa_attendance_record")
@EqualsAndHashCode(callSuper = true)
public class AttendanceRecordEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * 打卡规则id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long settId;
    /**
     * 所属部门
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long deptId;
    /**
     * 员工ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;
    /**
     * 考勤日期
     */
    private String date;
    /**
     * 打卡时间
     */
    private Date clockIn;
    /**
     * 考勤类型
     */
    private Integer type;
    /**
     * 标准时间（规则的时间）
     */
    private String gmtTime;
    /**
     * 考勤时间 冗余字段 统计时间用
     */
    private String attendanceTime;
    /**
     * 打卡详细地址
     */
    private String address;
    /**
     * 打卡经纬度
     */
    private String range;
    @TableField(exist = false)
    /**
     * 关联的树形名称
     */
    private String deptIdName;


    @TableField(exist = false)
    private String username;


    @TableField(exist = false)
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date limitStartTime;
    @TableField(exist = false)
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date limitEndTime;

    @TableField(exist = false)
    private List<Long> authDept;
}
